package git.soulbgm.config;

import git.soulbgm.common.DataBaseContextHolder;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 主从路由数据源
 *
 * @author HRJ
 * @date 2020/08/27
 */
public class MasterSlaveRoutingDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        return DataBaseContextHolder.get();
    }
}
